﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Admin/Views/Shared/AdminMaster.Master" Inherits="System.Web.Mvc.ViewPage<VietThuongLMS.Areas.Admin.Models.TinTucModel>" %>

<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript" src="<%: Url.Content("~/Scripts/MicrosoftAjax.js") %>"></script>
    <script type="text/javascript" src="<%: Url.Content("~/Scripts/MicrosoftMvcValidation.js") %>"></script>
    <script type="text/javascript" src="<%: Url.Content("~/Plugins/ckeditor/ckeditor.js") %>"></script>
    <script type="text/javascript" src="<%: Url.Content("~/Plugins/ckfinder/ckfinder.js") %>"></script>
    
<style type="text/css">
.validation-summary-errors 
{
    color: Red;
}
</style>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<legend>
        <h2>
            Cập nhật tin tức</h2>
    </legend>
    <%: Html.ValidationSummary() %>
    <% Html.EnableClientValidation();
       using (Html.BeginForm("Edit", "TinTuc", new { area = "Admin" }, FormMethod.Post, new { @class = "form-horizontal", @id = "formNew", @name = "formNew", enctype = "multipart/form-data" }))
       {
    %>
    <%: Html.HiddenFor(t => t.ID) %>
    <%: Html.ValidationSummary(true) %>
    <div class="control-group">
        <label class="control-label" for="strFrom">
            Tiêu đề:</label>
        <div class="controls">
            <%: Html.TextBoxFor(t => t.TieuDe, new { @class = "h30 span12", placeholder = "Tiêu đề..." })%>
            <%: Html.ValidationMessageFor(m => m.TieuDe) %>
            
        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="strFrom">
            Nội dung :</label>
        <div class="controls">
            <%: Html.ValidationMessageFor(m => m.NoiDung)%>
            <%: Html.TextAreaFor(t => t.NoiDung, new { @class = "ckeditor", placeholder = "Nội dung..." })%>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="strFrom">
            Hình bìa:</label>
        <div class="controls">
            <img src="<%=ResolveUrl("~/Images/TinTuc/")%><%=@Model.strUrlAvatar %>" alt="<%=@Model.strUrlAvatar %>" />
            <br />
            <%: Html.TextBoxFor(t => t.UrlAvatar, new { id = "UrlAvatar", type = "file" })%>
            <%: Html.ValidationMessageFor(m => m.UrlAvatar)%>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="strFrom">
            Thể loại:</label>
        <div class="controls">
            <%= Html.DropDownList("MaLoaiTinTuc")%>  
            <%: Html.ValidationMessageFor(m => m.Tag)%>
            
        </div>
    </div>
    <div class="control-group">
        <div class="controls">
            <button id="btnCreate" name="btnCreate" type="submit" class="btn btn-primary">Save</button>
        </div>
    </div>
    <% } %>

    <script type="text/javascript">
        var editor1 = CKEDITOR.replace("NoiDung", {
            height: "400"
        });
        CKFinder.setupCKEditor(editor1, "/ckfinder/")
    </script>
</asp:Content>

